package br.com.bestOffer.util;

import javax.annotation.ManagedBean;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

import br.com.bestOffer.enumerator.TipoUsuario;



/**
 * @author Franklin Bourguignon
 *
 *Converter para o Enum de Tipo Usuario
 */
@ManagedBean
public class TipoUsuarioConverter implements Converter {

	public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
		return Enum.valueOf(TipoUsuario.class, value);
	}

	public String getAsString(FacesContext facesContext, UIComponent component, Object value) {
		return value.toString();
	}

}
